/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 1.0.4</a>, using an XML
 * Schema.
 * $Id$
 */

package com.jzhao.jpre.format.sequential.castor;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

/**
 * Class LengthField.
 * 
 * @version $Revision$ $Date$
 */
public class LengthField implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _dataName
     */
    private java.lang.String _dataName;

    /**
     * Field _prefix
     */
    private java.lang.String _prefix;

    /**
     * Field _include
     */
    private boolean _include;

    /**
     * keeps track of state for field: _include
     */
    private boolean _has_include;

    /**
     * Field _suffixes
     */
    private java.lang.String _suffixes;

    /**
     * Field _valueLength
     */
    private int _valueLength;

    /**
     * keeps track of state for field: _valueLength
     */
    private boolean _has_valueLength;

    /**
     * Field _valuePadding
     */
    private java.lang.String _valuePadding;

    /**
     * Field _valueAlign
     */
    private java.lang.String _valueAlign;

    /**
     * Field _binary
     */
    private boolean _binary;

    /**
     * keeps track of state for field: _binary
     */
    private boolean _has_binary;

    /**
     * Field _endian
     */
    private boolean _endian;

    /**
     * keeps track of state for field: _endian
     */
    private boolean _has_endian;

    /**
     * Field _null
     */
    private boolean _null;

    /**
     * keeps track of state for field: _null
     */
    private boolean _has_null;

    /**
     * Field _field
     */
    private com.jzhao.jpre.format.sequential.castor.Field _field;


      //----------------/
     //- Constructors -/
    //----------------/

    public LengthField() 
     {
        super();
    } //-- com.jzhao.jpre.format.sequential.castor.LengthField()


      //-----------/
     //- Methods -/
    //-----------/

    /**
     */
    public void deleteBinary()
    {
        this._has_binary= false;
    } //-- void deleteBinary() 

    /**
     */
    public void deleteEndian()
    {
        this._has_endian= false;
    } //-- void deleteEndian() 

    /**
     */
    public void deleteInclude()
    {
        this._has_include= false;
    } //-- void deleteInclude() 

    /**
     */
    public void deleteNull()
    {
        this._has_null= false;
    } //-- void deleteNull() 

    /**
     */
    public void deleteValueLength()
    {
        this._has_valueLength= false;
    } //-- void deleteValueLength() 

    /**
     * Returns the value of field 'binary'.
     * 
     * @return the value of field 'Binary'.
     */
    public boolean getBinary()
    {
        return this._binary;
    } //-- boolean getBinary() 

    /**
     * Returns the value of field 'dataName'.
     * 
     * @return the value of field 'DataName'.
     */
    public java.lang.String getDataName()
    {
        return this._dataName;
    } //-- java.lang.String getDataName() 

    /**
     * Returns the value of field 'endian'.
     * 
     * @return the value of field 'Endian'.
     */
    public boolean getEndian()
    {
        return this._endian;
    } //-- boolean getEndian() 

    /**
     * Returns the value of field 'field'.
     * 
     * @return the value of field 'Field'.
     */
    public com.jzhao.jpre.format.sequential.castor.Field getField()
    {
        return this._field;
    } //-- com.jzhao.jpre.format.sequential.castor.Field getField() 

    /**
     * Returns the value of field 'include'.
     * 
     * @return the value of field 'Include'.
     */
    public boolean getInclude()
    {
        return this._include;
    } //-- boolean getInclude() 

    /**
     * Returns the value of field 'null'.
     * 
     * @return the value of field 'Null'.
     */
    public boolean getNull()
    {
        return this._null;
    } //-- boolean getNull() 

    /**
     * Returns the value of field 'prefix'.
     * 
     * @return the value of field 'Prefix'.
     */
    public java.lang.String getPrefix()
    {
        return this._prefix;
    } //-- java.lang.String getPrefix() 

    /**
     * Returns the value of field 'suffixes'.
     * 
     * @return the value of field 'Suffixes'.
     */
    public java.lang.String getSuffixes()
    {
        return this._suffixes;
    } //-- java.lang.String getSuffixes() 

    /**
     * Returns the value of field 'valueAlign'.
     * 
     * @return the value of field 'ValueAlign'.
     */
    public java.lang.String getValueAlign()
    {
        return this._valueAlign;
    } //-- java.lang.String getValueAlign() 

    /**
     * Returns the value of field 'valueLength'.
     * 
     * @return the value of field 'ValueLength'.
     */
    public int getValueLength()
    {
        return this._valueLength;
    } //-- int getValueLength() 

    /**
     * Returns the value of field 'valuePadding'.
     * 
     * @return the value of field 'ValuePadding'.
     */
    public java.lang.String getValuePadding()
    {
        return this._valuePadding;
    } //-- java.lang.String getValuePadding() 

    /**
     * Method hasBinary
     * 
     * 
     * 
     * @return true if at least one Binary has been added
     */
    public boolean hasBinary()
    {
        return this._has_binary;
    } //-- boolean hasBinary() 

    /**
     * Method hasEndian
     * 
     * 
     * 
     * @return true if at least one Endian has been added
     */
    public boolean hasEndian()
    {
        return this._has_endian;
    } //-- boolean hasEndian() 

    /**
     * Method hasInclude
     * 
     * 
     * 
     * @return true if at least one Include has been added
     */
    public boolean hasInclude()
    {
        return this._has_include;
    } //-- boolean hasInclude() 

    /**
     * Method hasNull
     * 
     * 
     * 
     * @return true if at least one Null has been added
     */
    public boolean hasNull()
    {
        return this._has_null;
    } //-- boolean hasNull() 

    /**
     * Method hasValueLength
     * 
     * 
     * 
     * @return true if at least one ValueLength has been added
     */
    public boolean hasValueLength()
    {
        return this._has_valueLength;
    } //-- boolean hasValueLength() 

    /**
     * Returns the value of field 'binary'.
     * 
     * @return the value of field 'Binary'.
     */
    public boolean isBinary()
    {
        return this._binary;
    } //-- boolean isBinary() 

    /**
     * Returns the value of field 'endian'.
     * 
     * @return the value of field 'Endian'.
     */
    public boolean isEndian()
    {
        return this._endian;
    } //-- boolean isEndian() 

    /**
     * Returns the value of field 'include'.
     * 
     * @return the value of field 'Include'.
     */
    public boolean isInclude()
    {
        return this._include;
    } //-- boolean isInclude() 

    /**
     * Returns the value of field 'null'.
     * 
     * @return the value of field 'Null'.
     */
    public boolean isNull()
    {
        return this._null;
    } //-- boolean isNull() 

    /**
     * Method isValid
     * 
     * 
     * 
     * @return true if this object is valid according to the schema
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * 
     * 
     * @param out
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * 
     * 
     * @param handler
     * @throws java.io.IOException if an IOException occurs during
     * marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Sets the value of field 'binary'.
     * 
     * @param binary the value of field 'binary'.
     */
    public void setBinary(boolean binary)
    {
        this._binary = binary;
        this._has_binary = true;
    } //-- void setBinary(boolean) 

    /**
     * Sets the value of field 'dataName'.
     * 
     * @param dataName the value of field 'dataName'.
     */
    public void setDataName(java.lang.String dataName)
    {
        this._dataName = dataName;
    } //-- void setDataName(java.lang.String) 

    /**
     * Sets the value of field 'endian'.
     * 
     * @param endian the value of field 'endian'.
     */
    public void setEndian(boolean endian)
    {
        this._endian = endian;
        this._has_endian = true;
    } //-- void setEndian(boolean) 

    /**
     * Sets the value of field 'field'.
     * 
     * @param field the value of field 'field'.
     */
    public void setField(com.jzhao.jpre.format.sequential.castor.Field field)
    {
        this._field = field;
    } //-- void setField(com.jzhao.jpre.format.sequential.castor.Field) 

    /**
     * Sets the value of field 'include'.
     * 
     * @param include the value of field 'include'.
     */
    public void setInclude(boolean include)
    {
        this._include = include;
        this._has_include = true;
    } //-- void setInclude(boolean) 

    /**
     * Sets the value of field 'null'.
     * 
     * @param _null
     * @param null the value of field 'null'.
     */
    public void setNull(boolean _null)
    {
        this._null = _null;
        this._has_null = true;
    } //-- void setNull(boolean) 

    /**
     * Sets the value of field 'prefix'.
     * 
     * @param prefix the value of field 'prefix'.
     */
    public void setPrefix(java.lang.String prefix)
    {
        this._prefix = prefix;
    } //-- void setPrefix(java.lang.String) 

    /**
     * Sets the value of field 'suffixes'.
     * 
     * @param suffixes the value of field 'suffixes'.
     */
    public void setSuffixes(java.lang.String suffixes)
    {
        this._suffixes = suffixes;
    } //-- void setSuffixes(java.lang.String) 

    /**
     * Sets the value of field 'valueAlign'.
     * 
     * @param valueAlign the value of field 'valueAlign'.
     */
    public void setValueAlign(java.lang.String valueAlign)
    {
        this._valueAlign = valueAlign;
    } //-- void setValueAlign(java.lang.String) 

    /**
     * Sets the value of field 'valueLength'.
     * 
     * @param valueLength the value of field 'valueLength'.
     */
    public void setValueLength(int valueLength)
    {
        this._valueLength = valueLength;
        this._has_valueLength = true;
    } //-- void setValueLength(int) 

    /**
     * Sets the value of field 'valuePadding'.
     * 
     * @param valuePadding the value of field 'valuePadding'.
     */
    public void setValuePadding(java.lang.String valuePadding)
    {
        this._valuePadding = valuePadding;
    } //-- void setValuePadding(java.lang.String) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled
     * com.jzhao.jpre.format.sequential.castor.LengthField
     */
    public static com.jzhao.jpre.format.sequential.castor.LengthField unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (com.jzhao.jpre.format.sequential.castor.LengthField) Unmarshaller.unmarshal(com.jzhao.jpre.format.sequential.castor.LengthField.class, reader);
    } //-- com.jzhao.jpre.format.sequential.castor.LengthField unmarshal(java.io.Reader) 

    /**
     * 
     * 
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
